package com.zhongge.doublelist;

/**
 * @ClassName TestMyLinkedList
 * @Description TODO 测试双向链表
 * @Author 笨忠
 * @Date 2025/8/10 19:26
 * @Version 1.0
 */
public class TestMyLinkedList {
    public static void main(String[] args) {
        MyLinkedList<Integer> list = new MyLinkedList<>();
        list.addLast(100);
        list.addLast(12);
        list.addLast(45);
        list.addLast(12);
        list.addLast(12);

        System.out.println("==========删除前：=========");
        list.display();


        System.out.println("==========删除后：=========");
        list.removeAllKey(12);
        list.display();
//        list.removeKey(12);
//        list.display();

//        list.removeKey(56);
//        list.display();
//        list.removeKey(34);
//        list.display();
//        list.display();
//        System.out.println("=======================");
//        list.addIndex(0, 12);
//        list.display();
//        System.out.println("=================");
//        list.addIndex(6, 12);
//        list.display();
//        System.out.println("=================");
//        list.addIndex(5, 100);
//        list.display();
//        System.out.println("=================");

        System.out.println("存储的是==》字符串");
        MyLinkedList<String> list1 = new MyLinkedList<>();
        list1.addLast("刘备");
        list1.addLast("刘备");
        list1.addLast("关羽");
        list1.addLast("张飞");
        list1.display();

        list1.removeKey("刘备");
        list1.display();
    }
}
